﻿using CarAppDto.Base;
using FluentValidation;

namespace CarAppDto.CarParts.CarPartsDtos
{
    /// <summary>
    ///数据校验类要继承自 AbstractValidator
    ///通过 AbstractValidator 的泛型参数指定对哪个类进行校验
    /// </summary>
    public class ReqAddCarPartsValidator : AbstractValidator<ReqAddCarParts>
    {
        /// <summary>
        /// 校验规则写到校验类的构造方法中
        /// </summary>
        public ReqAddCarPartsValidator()
        {
            RuleFor(x => x.Code).NotEmpty().Length(1, 20);
            RuleFor(x => x.Name).NotEmpty().Length(1, 128);
            RuleFor(x => x.CarPartsTypeId).NotEmpty();
            RuleFor(x => x.VehicleSeriesId).NotEmpty();
            RuleFor(x => x.BrandId).NotEmpty();

        }
    }
    public class ReqAddCarParts : BaseAddModel
    {
        /// <summary>
        /// 品牌
        /// </summary>
        public string? BrandId { get; set; }
        /// <summary>
        /// 车系Id
        /// </summary>
        public string? VehicleSeriesId { get; set; }
        /// <summary>
        /// 配件类型
        /// </summary>
        public string? CarPartsTypeId { get; set; }
        /// <summary>
        /// 配件中文名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 配件英文名称
        /// </summary>
        public string? EnglishName { get; set; }

        /// <summary>
        /// 配件名称代码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 起始时间
        /// </summary>
        public DateTime? StartingDate { get; set; }

        /// <summary>
        ///截至时间
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 图片路径
        /// </summary>
        public string? Image { get; set; }

        /// <summary>
        /// 自定义字段1
        /// </summary>
        public string? CustomFields1 { get; set; }

        /// <summary>
        /// 自定义字段2
        /// </summary>
        public string? CustomFields2 { get; set; }

        /// <summary>
        /// 自定义字段3
        /// </summary>
        public string? CustomFields3 { get; set; }

        /// <summary>
        /// 自定义字段4
        /// </summary>
        public string? CustomFields4 { get; set; }

        /// <summary>
        /// 自定义字段5
        /// </summary>
        public string? CustomFields5 { get; set; }

        /// <summary>
        /// 自定义字段6
        /// </summary>
        public string? CustomFields6 { get; set; }

        /// <summary>
        /// 自定义字段7
        /// </summary>
        public string? CustomFields7 { get; set; }

        /// <summary>
        /// 自定义字段8
        /// </summary>
        public string? CustomFields8 { get; set; }

        /// <summary>
        /// 自定义字段9
        /// </summary>
        public string? CustomFields9 { get; set; }

        /// <summary>
        /// 自定义字段10
        /// </summary>
        public string? CustomFields10 { get; set; }

    }
}
